.class public Lcom/brixd/niceapp/model/CommentModel;
.super Ljava/lang/Object;
.source "CommentModel.java"

# interfaces
.implements Ljava/io/Serializable;


# static fields
.field private static final serialVersionUID:J = -0x5709e6572edd5450L


# instance fields
.field private authorUser:Lcom/brixd/niceapp/model/CommonUserModel;

.field private commentId:I

.field private content:Ljava/lang/String;

.field private createdAt:Ljava/lang/String;

.field private isDigg:Z

.field private replayTimes:I

.field private replayToUser:Lcom/brixd/niceapp/model/CommonUserModel;

.field private type:Ljava/lang/String;

.field private upTimes:I


# direct methods
.method public constructor <init>()V
    .registers 1

    .prologue
    .line 20
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

.method public constructor <init>(Lcom/brixd/niceapp/model/CommentModel;)V
    .registers 3
    .param p1, "model"    # Lcom/brixd/niceapp/model/CommentModel;

    .prologue
    .line 21
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 22
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getCreatedAt()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->createdAt:Ljava/lang/String;

    .line 23
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getContent()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->content:Ljava/lang/String;

    .line 24
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getCommentId()I

    move-result v0

    iput v0, p0, Lcom/brixd/niceapp/model/CommentModel;->commentId:I

    .line 25
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getAuthorUser()Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->authorUser:Lcom/brixd/niceapp/model/CommonUserModel;

    .line 26
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getAuthorUser()Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->replayToUser:Lcom/brixd/niceapp/model/CommonUserModel;

    .line 27
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getReplayTimes()I

    move-result v0

    iput v0, p0, Lcom/brixd/niceapp/model/CommentModel;->replayTimes:I

    .line 28
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getUpTimes()I

    move-result v0

    iput v0, p0, Lcom/brixd/niceapp/model/CommentModel;->upTimes:I

    .line 29
    iget-boolean v0, p1, Lcom/brixd/niceapp/model/CommentModel;->isDigg:Z

    iput-boolean v0, p0, Lcom/brixd/niceapp/model/CommentModel;->isDigg:Z

    .line 30
    invoke-virtual {p1}, Lcom/brixd/niceapp/model/CommentModel;->getType()Ljava/lang/String;

    move-result-object v0

    iput-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->type:Ljava/lang/String;

    .line 31
    return-void
.end method

.method public static parseCommentModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommentModel;
    .registers 3
    .param p0, "jsonObj"    # Lorg/json/JSONObject;

    .prologue
    .line 120
    if-nez p0, :cond_4

    .line 121
    const/4 v0, 0x0

    .line 134
    :goto_3
    return-object v0

    .line 123
    :cond_4
    new-instance v0, Lcom/brixd/niceapp/model/CommentModel;

    invoke-direct {v0}, Lcom/brixd/niceapp/model/CommentModel;-><init>()V

    .line 124
    .local v0, "commentModel":Lcom/brixd/niceapp/model/CommentModel;
    const-string v1, "id"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setCommentId(I)V

    .line 125
    const-string v1, "content"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setContent(Ljava/lang/String;)V

    .line 126
    const-string v1, "created_at"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setCreatedAt(Ljava/lang/String;)V

    .line 127
    const-string v1, "reply_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setReplayTimes(I)V

    .line 128
    const-string v1, "up_times"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;)I

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setUpTimes(I)V

    .line 129
    const-string v1, "is_digg"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optBoolean(Ljava/lang/String;)Z

    move-result v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setDigg(Z)V

    .line 130
    const-string v1, "type"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setType(Ljava/lang/String;)V

    .line 131
    const-string v1, "author"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-static {v1}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setAuthorUser(Lcom/brixd/niceapp/model/CommonUserModel;)V

    .line 132
    const-string v1, "reply_to_author"

    invoke-virtual {p0, v1}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;

    move-result-object v1

    invoke-static {v1}, Lcom/brixd/niceapp/model/CommonUserModel;->parseUserModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommonUserModel;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/brixd/niceapp/model/CommentModel;->setReplayToUser(Lcom/brixd/niceapp/model/CommonUserModel;)V

    goto :goto_3
.end method

.method public static parseCommentModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;
    .registers 5
    .param p0, "jsonArray"    # Lorg/json/JSONArray;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONArray;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommentModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 110
    new-instance v1, Ljava/util/ArrayList;

    invoke-direct {v1}, Ljava/util/ArrayList;-><init>()V

    .line 111
    .local v1, "commentModels":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lcom/brixd/niceapp/model/CommentModel;>;"
    const/4 v2, 0x0

    .local v2, "i":I
    :goto_6
    invoke-virtual {p0}, Lorg/json/JSONArray;->length()I

    move-result v3

    if-ge v2, v3, :cond_1a

    .line 112
    invoke-virtual {p0, v2}, Lorg/json/JSONArray;->optJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    invoke-static {v3}, Lcom/brixd/niceapp/model/CommentModel;->parseCommentModel(Lorg/json/JSONObject;)Lcom/brixd/niceapp/model/CommentModel;

    move-result-object v0

    .line 113
    .local v0, "commentModel":Lcom/brixd/niceapp/model/CommentModel;
    invoke-virtual {v1, v0}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 111
    add-int/lit8 v2, v2, 0x1

    goto :goto_6

    .line 115
    .end local v0    # "commentModel":Lcom/brixd/niceapp/model/CommentModel;
    :cond_1a
    return-object v1
.end method

.method public static parseCommentModels(Lorg/json/JSONObject;)Ljava/util/ArrayList;
    .registers 2
    .param p0, "jsonObj"    # Lorg/json/JSONObject;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Lorg/json/JSONObject;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/brixd/niceapp/model/CommentModel;",
            ">;"
        }
    .end annotation

    .prologue
    .line 106
    const-string v0, "data"

    invoke-virtual {p0, v0}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

    move-result-object v0

    invoke-static {v0}, Lcom/brixd/niceapp/model/CommentModel;->parseCommentModels(Lorg/json/JSONArray;)Ljava/util/ArrayList;

    move-result-object v0

    return-object v0
.end method


# virtual methods
.method public getAuthorUser()Lcom/brixd/niceapp/model/CommonUserModel;
    .registers 2

    .prologue
    .line 58
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->authorUser:Lcom/brixd/niceapp/model/CommonUserModel;

    return-object v0
.end method

.method public getCommentId()I
    .registers 2

    .prologue
    .line 50
    iget v0, p0, Lcom/brixd/niceapp/model/CommentModel;->commentId:I

    return v0
.end method

.method public getContent()Ljava/lang/String;
    .registers 2

    .prologue
    .line 42
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->content:Ljava/lang/String;

    return-object v0
.end method

.method public getCreatedAt()Ljava/lang/String;
    .registers 2

    .prologue
    .line 34
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->createdAt:Ljava/lang/String;

    return-object v0
.end method

.method public getReplayTimes()I
    .registers 2

    .prologue
    .line 74
    iget v0, p0, Lcom/brixd/niceapp/model/CommentModel;->replayTimes:I

    return v0
.end method

.method public getReplayToUser()Lcom/brixd/niceapp/model/CommonUserModel;
    .registers 2

    .prologue
    .line 66
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->replayToUser:Lcom/brixd/niceapp/model/CommonUserModel;

    return-object v0
.end method

.method public getType()Ljava/lang/String;
    .registers 2

    .prologue
    .line 98
    iget-object v0, p0, Lcom/brixd/niceapp/model/CommentModel;->type:Ljava/lang/String;

    return-object v0
.end method

.method public getUpTimes()I
    .registers 2

    .prologue
    .line 82
    iget v0, p0, Lcom/brixd/niceapp/model/CommentModel;->upTimes:I

    return v0
.end method

.method public isDigg()Z
    .registers 2

    .prologue
    .line 90
    iget-boolean v0, p0, Lcom/brixd/niceapp/model/CommentModel;->isDigg:Z

    return v0
.end method

.method public setAuthorUser(Lcom/brixd/niceapp/model/CommonUserModel;)V
    .registers 2
    .param p1, "authorUser"    # Lcom/brixd/niceapp/model/CommonUserModel;

    .prologue
    .line 62
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommentModel;->authorUser:Lcom/brixd/niceapp/model/CommonUserModel;

    .line 63
    return-void
.end method

.method public setCommentId(I)V
    .registers 2
    .param p1, "commentId"    # I

    .prologue
    .line 54
    iput p1, p0, Lcom/brixd/niceapp/model/CommentModel;->commentId:I

    .line 55
    return-void
.end method

.method public setContent(Ljava/lang/String;)V
    .registers 2
    .param p1, "content"    # Ljava/lang/String;

    .prologue
    .line 46
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommentModel;->content:Ljava/lang/String;

    .line 47
    return-void
.end method

.method public setCreatedAt(Ljava/lang/String;)V
    .registers 2
    .param p1, "createdAt"    # Ljava/lang/String;

    .prologue
    .line 38
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommentModel;->createdAt:Ljava/lang/String;

    .line 39
    return-void
.end method

.method public setDigg(Z)V
    .registers 2
    .param p1, "isDigg"    # Z

    .prologue
    .line 94
    iput-boolean p1, p0, Lcom/brixd/niceapp/model/CommentModel;->isDigg:Z

    .line 95
    return-void
.end method

.method public setReplayTimes(I)V
    .registers 2
    .param p1, "replayTimes"    # I

    .prologue
    .line 78
    iput p1, p0, Lcom/brixd/niceapp/model/CommentModel;->replayTimes:I

    .line 79
    return-void
.end method

.method public setReplayToUser(Lcom/brixd/niceapp/model/CommonUserModel;)V
    .registers 2
    .param p1, "replayToUser"    # Lcom/brixd/niceapp/model/CommonUserModel;

    .prologue
    .line 70
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommentModel;->replayToUser:Lcom/brixd/niceapp/model/CommonUserModel;

    .line 71
    return-void
.end method

.method public setType(Ljava/lang/String;)V
    .registers 2
    .param p1, "type"    # Ljava/lang/String;

    .prologue
    .line 102
    iput-object p1, p0, Lcom/brixd/niceapp/model/CommentModel;->type:Ljava/lang/String;

    .line 103
    return-void
.end method

.method public setUpTimes(I)V
    .registers 2
    .param p1, "upTimes"    # I

    .prologue
    .line 86
    iput p1, p0, Lcom/brixd/niceapp/model/CommentModel;->upTimes:I

    .line 87
    return-void
.end method
